/* Author : Putri Andita R
 * 		    091511059
 * Proyek 4*/


package jtk.project4.fleet.field;

import java.awt.FlowLayout;

import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.MemoField;
import nl.coderight.jazz.form.field.button.PushButton;

public class PhotoField extends GroupControl{	
	
	private MemoField  phototextArea;
	private PushButton addPhotoPushButton;
	private PushButton deletePhotoPushButton;
	private PushButton viewimagePhotoPushButton;
			
	
	public PhotoField(String bindID)
	{
		setBindID(bindID);
		createFields();
		createLayout();		
	}	
	
	private void createFields() 
	{
		phototextArea = new MemoField();
		phototextArea.setRows(20);
		
		addPhotoPushButton = new PushButton("Add");
		deletePhotoPushButton = new PushButton("Delete");
		viewimagePhotoPushButton = new PushButton("View image");
		
	}
	
	private void createLayout() 
	{
		// TODO Auto-generated methodstub
		setLayout(new FormLayout())
		//addLabel("label.phototextArea");
		//addField(phototextArea)
		.addField(phototextArea)
		.addRow()
		.addField(createButtonsFields())
		;
	}

	private GroupControl createButtonsFields() {
		// TODO Auto-generated method stub
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.LEFT));
		buttons.addField(addPhotoPushButton);
		buttons.addField(deletePhotoPushButton);
		buttons.addField(viewimagePhotoPushButton);
				
		return buttons;
	}
}
		
	
	
	